package com.rem.cloudalibaba.service.sentinel;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.stereotype.Service;

/**
 * 流控规则配置
 *
 * @author Rem
 * @date 2021-07-20
 */


@Service
public class SentinelFlowService {

    /**
     * sentinelResource 资源 对上级资源限App限流   对Mini小程序没有影响
     * 可以通过配置关闭：spring.cloud.sentinel.web-context-unify=false
     * App 限流后被报错 com.alibaba.csp.sentinel.slots.block.flow.FlowException: null
     *
     * @return
     */
    @SentinelResource("flow-qps-link")
    public String sentinelQpsResource() {
        return "qps-链路-快速失败";
    }

}
